﻿using System;
using UnityEngine;
using UnityEngine.UI;

// Token: 0x020003DC RID: 988
[RequireComponent(typeof(Text))]
public class FPS_Counter : MonoBehaviour
{
	// Token: 0x060018B4 RID: 6324 RVA: 0x000A13B8 File Offset: 0x0009F5B8
	private void Start()
	{
		this.timer = 0f;
		this.tmp = 0f;
		this.nowFPS = 0f;
		this.text = base.GetComponent<Text>();
	}

	// Token: 0x060018B5 RID: 6325 RVA: 0x000A13E8 File Offset: 0x0009F5E8
	private void Update()
	{
		if (this.timer >= this.UpdateTime)
		{
			this.nowFPS = this.counter / this.timer;
			this.timer = 0f;
			this.counter = 0f;
		}
		this.timer += Time.deltaTime;
		this.counter += 1f;
		this.text.text = this.nowFPS.ToString("000") + this.fpsText;
	}

	// Token: 0x04001C25 RID: 7205
	public float UpdateTime = 1f;

	// Token: 0x04001C26 RID: 7206
	public string fpsText = "FPS";

	// Token: 0x04001C27 RID: 7207
	private float timer;

	// Token: 0x04001C28 RID: 7208
	private float tmp;

	// Token: 0x04001C29 RID: 7209
	private float nowFPS;

	// Token: 0x04001C2A RID: 7210
	private float counter;

	// Token: 0x04001C2B RID: 7211
	private Text text;
}
